extends patient-bar

block body
	div(class="wrapper")
	div(id="container")
		div(class="wrapper")
			table(width="100%")
				tbody
					td(width="50%")
						div(class="column")
							div(class="subnav")
							form
								table(width="100%")
									caption
										h2 Ajouter un patient
									tbody
										td
											fieldset
												input(type="checkbox", ng-model="here")
												input(type="text", ng-model="nom", ng-change="getAllPatients(nom)", placeholder="nom")
												input(type="text", ng-model="prenom", placeholder="prenom")
												input(type="date", ng-model="date_naissance")
												button(ng-click="createPatient(here,nom,prenom,date_naissance)") Creer le patient
								table(width="100%")
									caption
										h2 Rechercher un patient
									tbody
										td
											fieldset
												input(ng-model="nom", ng-change="getAllPatients(nom)", placeholder="Rechercher par nom")
												label Trier par:
												select(ng-model="orderProp")
													option(value="nom") Nom
													option(value="date_naissance") Date de Naissance
								table(width="100%")
									caption
										h2 Patientèle: {{getTotalPatients()}} patients
									tbody
										tr(ng-repeat="local_patient in patient_list | orderBy:orderProp")
											td
												input(type="checkbox", ng-model='local_patient.here', ng-click="addOrRemovePatientFromWaitingList(local_patient)")
											td
												a(ng-href="/patient-details", ng-click="viewPatientDetails(local_patient)") <strong>{{local_patient.nom}}</strong> {{local_patient.prenom}} [{{local_patient.id}}] {{local_patient.path}}
											td
												button(ng-click="removePatient(local_patient)") Trash
					td(width="50%")
						div(class="content")
							table(width="100%")
								caption
									h3 Salle d'attente: {{getTotalPatientsHere()}}
								thead
									th(width="20px") 
									th() NOM
								tbody
									tr(ng-repeat="patient in getWaitingList()")
										td 
											input(type="checkbox", ng-model="patient.here", ng-click="removePatientFromWaitingList(patient)")
										td
											a(href="/patient-consult", ng-click="getPatientConsult(patient)") <i>Prendre le patient</i> <strong><u>{{patient.nom}}</u> {{patient.prenom}}</strong> 
